home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Just Call Me Internet
/
Just Call Me Internet.iso
/
prog
/
atari
/
m2
/
cat3src
/
putz
/
putzlog.i
< prev
next >
Wrap
Text File
|
1997-10-26
|
4KB
|
135 lines
IMPLEMENTATION MODULE PutzLog;
(*==============================================================*
* Modul: CAT Import-Logfile *
* Autor: Johannes Gttker-Schnetmann *
* erstellt am: 09.06.1991 *
* letzte nderung am: 09.06.91 *
* Version: 1.2 *
* Interne Version: V#0001 *
*==============================================================*
*----------------------------------------------------------------------------
* Datum Vers. Autor nderung (Arbeitsbericht)
*----------------------------------------------------------------------------
* 09.06.91 1.2 JGS erste Version
*
* 13.08.91 1.216 DS Buffergren bei OpenTexfile gendert, da bei 0 32 kB
* alloziert werden.
*
*
*----------------------------------------------------------------------------
*)
IMPORT mtTextfiles;
IMPORT MagicStrings;
IMPORT MagicDOS;
FROM TimeConvert IMPORT DateToText, TimeToText;
FROM Clock IMPORT CurrentTime, CurrentDate;
CONST logName = 'CATPUTZ.LOG';
VAR log : mtTextfiles.TEXTFILE;
open: BOOLEAN;
(*$W-*)
PROCEDURE WriteString(REF str : ARRAY OF CHAR);
BEGIN
IF open THEN
mtTextfiles.WriteLine(log, str);
END;
END WriteString;
(*$W=*)
PROCEDURE WriteCard(c : LONGCARD);
BEGIN
IF open THEN
mtTextfiles.WriteLongCard(log, c, 0);
END;
END WriteCard;
PROCEDURE Write(c : CHAR);
BEGIN
IF open THEN
mtTextfiles.WriteChar(log, c);
END;
END Write;
PROCEDURE WriteLn();
BEGIN
IF open THEN
mtTextfiles.WriteLn(log);
END;
END WriteLn;
PROCEDURE WriteLine(REF str : ARRAY OF CHAR);
BEGIN
WriteString(str); WriteLn();
END WriteLine;
PROCEDURE putDate();
VAR z1,z2,z3,z4 : CARDINAL;
tmpStr : ARRAY [0..40] OF CHAR;
BEGIN
DateToText (CurrentDate(), 'DD.MM.YYYY', tmpStr);
WriteString (tmpStr);
WriteString (', ');
TimeToText (CurrentTime(), 'HH:MM.SS Uhr', tmpStr);
WriteString (tmpStr);
(*
z1 := MagicDOS.Tgetdate();
CardToDate(z1, z2,z3,z4); (* Jahr, Monat, Tag *)
WriteCard(z4);
Write('.');
WriteCard(z3);
Write('.');
WriteCard(z2);
Write(' ');
z1 := MagicDOS.Tgettime();
CardToTime(z1, z2,z3,z4); (* Stunde, Minute, Sekunde *)
WriteCard(z2);
Write(':');
WriteCard(z3);
Write(':');
WriteCard(z4);
*)
END putDate;
PROCEDURE putTime();
VAR z1,z2,z3,z4 : CARDINAL;
tmpStr : ARRAY [0..40] OF CHAR;
BEGIN
TimeToText (CurrentTime(), 'HH:MM.SS ', tmpStr);
WriteString (tmpStr);
END putTime;
PROCEDURE OpenLog(REF path : ARRAY OF CHAR):BOOLEAN;
VAR scrap : ARRAY[0..255] OF CHAR;
BEGIN
MagicStrings.Assign(path, scrap);
MagicStrings.Append(logName, scrap);
(* Buffergren verndert *)
open := mtTextfiles.OpenTextfile(scrap, mtTextfiles.WRITE, 8192, log) OR
mtTextfiles.OpenTextfile(scrap, mtTextfiles.WRITE, 512, log);
putDate();
WriteLine(' Log-Datei geffnet');
WriteLine('--------------------------------------------------');
RETURN open
END OpenLog;
PROCEDURE CloseLog();
BEGIN
IF open THEN
WriteString('Log-Datei geschlossen am ');
putDate();
WriteLn();
mtTextfiles.CloseTextfile(log);
END;
END CloseLog;
BEGIN
open := FALSE
END PutzLog.